package com.ruoyi.common.utils;

import com.ruoyi.common.utils.http.HttpPostUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * 功能说明: 云集短信工具类<br>
 * 开发人员: @author Mr.Wen<br>
 * 开发时间: 2023-7-13 16:20<br>
 **/
public class YunJiSmsUtil {
    /**
     * 发送短信
     *
     * @param url
     * @param userCode
     * @param userPass
     * @param mobile
     * @param content
     * @return
     */
    public static String sendSms(String url, String userCode, String userPass, String mobile, String content) throws Exception {
        Map<String, String> params = new HashMap<>();
        params.put("userCode", userCode);
        params.put("userPass", userPass);
        params.put("DesNo", mobile);
        params.put("Msg", content);
        return HttpPostUtil.postForm(url, params);
    }

    public static void main(String[] args) {
        /*String url = "https://118.178.116.15:8443/winnerrxd/api/trigger/SendMsg";
        Map<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("userCode", "");
        paramMap.put("userPass", "");
        paramMap.put("DesNo", "");
        paramMap.put("Msg", "【鑫盛】验证码123459，您正在登录，若非本人操作，请勿泄露。");
        try {
            HttpPostUtil.postForm(url, paramMap);
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("调用https失败:" + e);
        }*/
    }
}
